home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ShapeUIMac.c
-
- Copyright 1996 by Adobe Systems, Inc.
-
- C source file for Mac specific code for Shape example.
- */
-
- #include "Shape.h"
-
- /*****************************************************************************/
-
- /* Displays the about dialog box for the plug-in module. */
-
- void DoAbout (GPtr globals)
- {
- ShowAbout(gStuff->hostSig, AboutID);
- }
-
- /*****************************************************************************/
-
- /* Setup the parameters dialog. Returns TRUE if it succeeds. */
-
- Boolean DoParameters (GPtr globals)
- {
-
- short item;
- DialogPtr dp;
- DialogTHndl dialogHdl;
- dialogHdl = (DialogTHndl) GetResource ('DLOG', uiID);
-
- if (dialogHdl == NULL || *dialogHdl == NULL)
- return false;
- else
- {
-
- HNoPurge ((Handle) dialogHdl);
-
- CenterDialog (dialogHdl);
- SetUpMoveableModal (dialogHdl, gStuff->hostSig);
-
- dp = GetNewDialog (uiID, nil, (WindowPtr) -1);
-
- /* I am throwing away the results from these routines.
- Toolbox TechNote 37 does not document what error values they return.
- Also, the worst that happens is that the interface isn't quite right. */
-
- (void) SetDialogDefaultItem (dp, ok);
- (void) SetDialogCancelItem (dp, cancel);
- (void) SetDialogTracksCursor (dp, TRUE);
-
- SetRadioGroupState (dp,
- kFirstItem,
- kLastItem,
- kFirstItem + gWhatShape);
-
- SetRadioGroupState (dp,
- kCreateRadio1,
- kCreateRadioLast,
- kCreateRadio1 + gCreate);
-
- SelectWindow (dp);
-
- do
- {
-
- MoveableModalDialog (dp, gStuff->processEvent, nil, &item);
-
- if (item >= kFirstItem && item <= kLastItem)
- SetRadioGroupState (dp, kFirstItem, kLastItem, item);
- else if (item >= kCreateRadio1 && item <= kCreateRadioLast)
- SetRadioGroupState (dp, kCreateRadio1, kCreateRadioLast, item);
- }
- while (item != ok && item != cancel);
-
- if (item == ok)
- {
- gWhatShape = GetRadioGroupState(dp, kFirstItem, kLastItem) - kFirstItem;
- gCreate = GetRadioGroupState(dp, kCreateRadio1, kCreateRadioLast) - kCreateRadio1;
- }
- else
- gResult = userCanceledErr;
-
- DisposDialog (dp);
-
- if (dialogHdl != NULL && *dialogHdl != NULL)
- HPurge ((Handle) dialogHdl);
-
- dp = NULL;
- dialogHdl = NULL;
-
- return item == ok;
-
-
- } // else
- }
-
- /*********************************************************************/
-